<?php
/* Description: This file is used to add main category. */
#########IncludeFiles####################################################################################
include_once '../inc/config.php';
include_once("../inc/bootstrape.php");
require_once _SITE_PATH_.'classes/Vendor/Vendor.php';
require_once _SITE_PATH_.'classes/Category/Category.php';
require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

if( $_POST['submit']=='Submit'){    
    $parms['name'] = $_POST['name'];
	$parms['parent_id'] = 0;
	$parms['added'] = date("Y-m-d h:i:s");
	$parms['modified'] = date("Y-m-d h:i:s");;
           
    if( CommonUtility::insertData($parms, 'category')) {        
        header("Location: category_mng.php?msg=1084");            
        exit;
    }
    $err = 1085;    
}

$errMsg = $err;
$_tplName = 'category/category_add.tpl';
$_title = 'Add Category';

require_once _ADMIN_TPL_MAIN_;
?>